import { mongo } from "../mogoConfig";

// 更新第一个item等于paper的文档

const db = mongo.db("my_test")
db.collection("inventory")
    .updateOne({ item: 'paper' },
        {
            $set: {
                'size.uom': 'cm',
                status: 'P'
            },
            $currentDate: { lasetModified: true }
        }


    ).then(result => {
        console.log(result)
    }).catch(error => {
        console.log(error)
    }).finally(() => {
        mongo.close()
    })

console.log("执行结束")